import java.util.Scanner;

/**
 * @author 陈裕星
 * @version 1.0
 */
public class 两数相加 {
    public static void main(String[] args) {
        Node head1 = new Node(0);
        Node head2 = new Node(0);
        Node head = new Node(0);
        Node temp = head1;
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            Node node = new Node(sc.nextInt());
            temp.next = node;
            temp = temp.next;
        }
        temp = head2;
        for (int i = 0; i < 3; i++) {
            Node node = new Node(sc.nextInt());
            temp.next = node;
            temp = temp.next;
        }
        //定义一个数字记录是否要进位
        int carry = 0;
        Node res = head;
        while(head1.next != null && head2.next != null){
            int val = head1.next.val + head2.next.val + carry;
            int gewei = val % 10;
            carry = val / 10;
            Node node = new Node(gewei);
            res.next = node;
            res = res.next;
            head1 = head1.next;
            head2 = head2.next;
        }
        res = head.next;
        StringBuilder sb = new StringBuilder();
        while(res != null){
            int n = res.val;
            sb.append(n);
            res = res.next;
        }
        System.out.print(sb.reverse().toString());
    }
}
class Node {
    int val;
    Node next;
    public Node(int val){
        this.val = val;
    }
}
